<template>
    <div class="form-answer-question">
        <div id="form-answer-question">
            <cube-input v-model.trim="question" placeholder="请输入问题" :maxlength="50"></cube-input>
            <cube-input v-model.trim="answer" placeholder="请输入正确答案" :maxlength="20"></cube-input>
        </div>
    </div>
</template>

<script>
// 问答题
export default {
    name: "form-answer-question",
    data(){
        return {
            question:"",  //问题
            answer:""   //答案
        }
    },
    computed:{
        //数据
        data(){
            return [this.question,this.answer];
        }
    },
    model:{
        prop:'value',
            event: 'change'
    },
    props:{
        value:{
            type:Array,
        default(){
                return [];
            }
        }
    },
    watch: {
        data(value) {
            this.$emit("change",value)
        }
    },
    mounted() {
        this.question = this.value[0]
        this.answer = this.value[1]
    }
}
</script>

<style scoped></style>
